<template>
  <h3>
    <br>
    请输⼊要发送的内容:<input type="text" v-model="msg">
    <button @click="postMsg">发送</button>
  </h3>
</template>
<script>
export default {
  data() {
    return{
      msg:''
    }
  },
  methods:{
//this.$emit("⾃定义事件名",要传递的消息)
    postMsg(){
      this.$emit("getMsg",this.msg)
    }
  }
}
</script>